-- while 型控制结构
x = 1
sum = 0

while x <= 5 do
  sum = sum + x
  x = x + 1
end

print(sum)

-- 提供 标准控制语句 break, for 循环 索引从 1 开始
local t = {1, 3, 5, 8, 11, 18, 21}
local i
for i, v in ipairs(t) do
  if 11 == v then
    print("index[".. i .."] have right value[11]")
    break
  end
end